﻿using EYangFramework.Domain.Entitys.ValueObjects;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EYangFramework.Domain.Entitys.Entrys
{
    [Table("EYANG_ROLE")]
    public class Role : Entity
    {
        [StringLength(20)]
        public virtual string ROLENAME { get; set; }
        public virtual Role PARENT { get; set; }
        public virtual ICollection<User> USERS { get; set; }
        public virtual ICollection<Navigation> NAVIGATIONS { get; set; }//角色与导航的关系为多对多
        public virtual ICollection<Menu> MENUS { get; set; } 
        public Role() { }
        public Role(string name, Role parent, List<User> users,User creatUser):base(creatUser)
        {
            this.ROLENAME = name;
            this.PARENT = parent;
            this.USERS = users;
        }
    }
}
